import java.util.*;
public class Tao
{
	public static void main (String[] args)
	{
		Random in = new Random();
		Scanner out = new Scanner(System.in);
		String num = "y";
		while (num.equals("y"))
		{
			System.out.print("how many do you need?");
			int num1= out.nextInt();
			int sum = 0;
			for (int i = 0;i < num1;i++)
			{
				int num2 = in.nextInt(6) + 6;
				int num3 = num2%6;
				switch (num3)
				{
					case 0:
						int a,b;
						a = in.nextInt(21) - 10;
						b = in.nextInt(21) - 10;
						
						System.out.println (a + "+"+ b+ "=" +"?");
						int d = out.nextInt();
						if (d == a + b)
						{	System.out.println ("true");
						        sum = sum + 1;
						}
						else 
							System.out.println ("wrong");
						break;
				        case 1:
                                               int e,f,g;
						e = in.nextInt(21) - 10;
						f = in.nextInt(21) - 10;
						System.out.println ( e + "-"+f+"="+"?");
						 g = out.nextInt();
						if (g == e - f )
						{	System.out.println ("true");
						        sum = sum + 1;
						}
						else
							System.out.println ("wrong");
						break;
				        case 2:
						int h,v,j;
						h = in.nextInt(21) - 10;
						v = in.nextInt(21) - 10;
						System.out.println (h + "*"+v+"="+"?");
						 j = out.nextInt();
						if (j == h*v)
						{	System.out.println("true");
						        sum = sum +1;
						}
						else
							System.out.println("wrong");
						break;
					case 3:
						int k,l,m;
						k = in.nextInt(21) - 10;
						l = in.nextInt(21) - 10;
						System.out.println (k +"/"+l+"="+"?");
						m = out.nextInt();
						if(m== k/l)
						{	System.out.println("true");
						        sum = sum +1;
						}
						else
							System.out.println("wrong");
						break;
					case 4:
						int c,n,o,p;
						c = in.nextInt(21) - 10;
						n = in.nextInt(21) - 10;
						o = in.nextInt(21) - 10;
						System.out.println (c +"+"+n+"*"+o+"="+"?");
						p = out.nextInt();
						if(p == c+n*o)
						{	System.out.println("true");
							sum = sum +1;
						}
						else
							System.out.println("wrong");
						break;
					case 5:
						int q,r,s,ss;
						q = in.nextInt(21) + 1;
						r = in.nextInt(21) + 1;
						s = in.nextInt(21) + 1;
						ss = in.nextInt(21) + 1;
						System.out.println (q+"/"+r+"+"+s+"/"+ss+"="+"?");
						String t = out.nextLine();
						int rss = r * ss;
						int sr = s*r;
						int qss = q * ss;
						int srss = sr + qss;
						String oo = new String(srss+"/"+rss);
						if(t == q/r+s)
						{	System.out.println("true");
							sum = sum +1;
						}
						else
							System.out.println("wrong");
						break;
				}
			}
			System.out.println ("You have correct:"+sum);
			System.out.println ("correct rate:" + sum/10);
			System.out.println ("Do you want to try again ?(y/n)");
			num = out.nextLine();
			num = out.nextLine();


		}
	}
}





							
						

